
#!/usr/bin/python
# Filename: 04.py
import sys
from os import sep as PSEP
#print PSEP
fp = file(sys.path[0]+PSEP+'resources'+PSEP+'4.in', 'r')
res = ''
while True:
	line = fp.readline()
	if(len(line) == 0):
		break
	line = 'x'+line+'x'
	for i in range(4, len(line)-4):
		if(False == str.islower(line[i])):
			continue
		if(False == str.isupper(line[i+3]) or False == str.isupper(line[i+2]) or False == str.isupper(line[i+1])):
			continue
		if(False == str.isupper(line[i-3]) or False == str.isupper(line[i-2]) or False == str.isupper(line[i-1])):
			continue
		if(False == str.islower(line[i-4]) or False == str.islower(line[i+4])):
			continue
		res += line[i]
		#print(line[i-3:i+4])
print res

##regular expression##
#import re
#"".join(re.findall('[^A-Z][A-Z]{3}([a-z])[A-Z]{3}[^A-Z]', text))
#'linkedlist'